package com.yhb.channel.impl.SXY;

import com.yhb.channel.ChannelFactory;
import com.yhb.channel.exception.PayChannelException;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class SXYException extends PayChannelException {
    /**
     * code域划分
     * 第1位 通道号
     * 第2-3位 错误类型
     * 第4-8位 通道错误码
     */
    // 定义 只用于参照
    private static final String CHANNEL_CODE = "1";
    private static final String OTHER_ERROR = "00";
    private static final String NETWORK_ERROR = "01";

    public SXYException(Long code, String message) {
        super(code, message);
        this.channelType = ChannelFactory.SXY;
        this.channelName = "首信易";
    }

    public SXYException(Long code, String message, Throwable nestedException) {
        super(code, message, nestedException);
        this.channelType = ChannelFactory.SXY;
        this.channelName = "首信易";
    }

    public SXYException(String code, String message, Throwable nestedException) {
        super(code, message, nestedException);
        this.channelType = ChannelFactory.SXY;
        this.channelName = "首信易";
    }
}
